package com.hengpeng.msls.port.client.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;

import com.hengpeng.common.persist.entity.AbstractTableAutoIdEntity;

/**
 * <pre>
 * TODO 微信用户信息
 * </pre>
 * @author chenxiaobao
 * @add wangtongbin
 * @version 1.0, 2014-4-10
 */

@Entity
public class WXMemberInfo extends AbstractTableAutoIdEntity
{
	private static final long serialVersionUID = -3569408306600473857L;

	/**
	 * 关注来源
	 */
	public static enum SubScribeSource
	{
		/**
		 * 搜索
		 */
		SEARCH("搜索", 1001),
		/**
		 * 二维码
		 */
		CODE("二维码", 1002);

		private String text;

		private int value;

		SubScribeSource(String text, int value)
		{
			this.text = text;
			this.value = value;
		}

		public String getText()
		{
			return text;
		}

		public int getValue()
		{
			return value;
		}

		public void setText(String text)
		{
			this.text = text;
		}

		public void setValue(int value)
		{
			this.value = value;
		}
		public static SubScribeSource valueOf(int SourceNum)
		{
			SubScribeSource[] values = SubScribeSource.values();
			for (SubScribeSource subVal : values)
			{
				if (subVal.value == SourceNum)
				{
					return subVal;
				}
			}
			return null;
		}
	}

	/**
	 * 是否关注
	 */
	public static enum IsSubScribe
	{
		/**
		 * 否
		 */
		NO("否", 1001),
		/**
		 * 是
		 */
		YES("是", 1002);

		private String text;

		private int value;

		IsSubScribe(String text, int value)
		{
			this.text = text;
			this.value = value;
		}

		public String getText()
		{
			return text;
		}

		public int getValue()
		{
			return value;
		}

		public void setText(String text)
		{
			this.text = text;
		}

		public void setValue(int value)
		{
			this.value = value;
		}
		public static IsSubScribe valueOf(int IsSubNum)
		{
			IsSubScribe[] values = IsSubScribe.values();
			for (IsSubScribe Isval : values)
			{
				if (Isval.value == IsSubNum)
				{
					return Isval;
				}
			}
			return null;
		}
	}

	/**
	 * 性别类型
	 */
	public static enum SexType
	{
		/**
		 * 男
		 */
		MAN("男", 1),
		/**
		 * 女
		 */
		WOMAN("女", 2),

		/**
		 * 未知
		 */
		UNKNOWN("未知", 0);

		private String text;

		private int value;

		SexType(String text, int value)
		{
			this.text = text;
			this.value = value;
		}

		public String getText()
		{
			return text;
		}

		public int getValue()
		{
			return value;
		}

		public void setText(String text)
		{
			this.text = text;
		}

		public void setValue(int value)
		{
			this.value = value;
		}
		
		public static SexType valueOf(int sexNum)
		{
			SexType[] values = SexType.values();
			for (SexType Sex : values)
			{
				if (Sex.value == sexNum)
				{
					return Sex;
				}
			}
			return null;
		}
	}

	/**
	 * 微信唯一标示
	 */
	private String openID;

	/**
	 * 关注时间
	 */
	private Date subscribeTime;

	/**
	 * 关注来源 1001 搜索 1002二维码
	 */
	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private SubScribeSource subscribeSource;

	/**
	 * 取消关注时间
	 */
	private Date unsubscribeTime;

	/**
	 * 是否关注 1001 否 1002 是( 默认1001)
	 */
	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private IsSubScribe isSubscribe;

	/**
	 * 昵称
	 */
	private String nickname;

	/**
	 * 用户的性别，值为1时是男性，值为2时是女性，值为0时是未知
	 */
	@Column(length = 20)
	@Enumerated(javax.persistence.EnumType.STRING)
	private SexType sex;

	/**
	 * 城市
	 */
	private String city;

	/**
	 * 国家
	 */
	private String country;

	/**
	 * 用户的语言，简体中文为zh_CN
	 */
	private String language;

	/**
	 * 用户Id
	 */
	private String userId;
	/**
	 * 用户头像
	 */
	private   String headimgurl; 


	/**
	 * 二维码场景值 （非二维码来源则为空）
	 */
	private String scene_id;

	public String getOpenID()
	{
		return openID;
	}

	public void setOpenID(String openID)
	{
		this.openID = openID;
	}

	public Date getSubscribeTime()
	{
		return subscribeTime;
	}

	public void setSubscribeTime(Date subscribeTime)
	{
		this.subscribeTime = subscribeTime;
	}

	public SubScribeSource getSubscribeSource()
	{
		return subscribeSource;
	}

	public void setSubscribeSource(SubScribeSource subscribeSource)
	{
		this.subscribeSource = subscribeSource;
	}

	public Date getUnsubscribeTime()
	{
		return unsubscribeTime;
	}

	public void setUnsubscribeTime(Date unsubscribeTime)
	{
		this.unsubscribeTime = unsubscribeTime;
	}

	public IsSubScribe getIsSubscribe()
	{
		return isSubscribe;
	}

	public void setIsSubscribe(IsSubScribe isSubscribe)
	{
		this.isSubscribe = isSubscribe;
	}

	public String getNickname()
	{
		return nickname;
	}

	public void setNickname(String nickname)
	{
		this.nickname = nickname;
	}

	public SexType getSex()
	{
		return sex;
	}

	public void setSex(SexType sex)
	{
		this.sex = sex;
	}

	public String getCity()
	{
		return city;
	}

	public void setCity(String city)
	{
		this.city = city;
	}

	public String getCountry()
	{
		return country;
	}

	public void setCountry(String country)
	{
		this.country = country;
	}

	public String getLanguage()
	{
		return language;
	}

	public void setLanguage(String language)
	{
		this.language = language;
	}

	public String getUserId()
	{
		return userId;
	}

	public void setUserId(String userId)
	{
		this.userId = userId;
	}

	public String getScene_id()
	{
		return scene_id;
	}

	public void setScene_id(String scene_id)
	{
		this.scene_id = scene_id;
	}

	public String getHeadimgurl() {
		return headimgurl;
	}

	public void setHeadimgurl(String headimgurl) {
		this.headimgurl = headimgurl;
	}
	
}
